$(
    function () {
        $("#login_form").submit(
            function () {
                if(!checkEmpty("username","会员名")|| ! checkEmpty("userpass","会员密码"))
                    return false;
            }
        );
        $("#ajaxButton").click(
            function () {
                if(!checkEmpty("username1","会员名")|| ! checkEmpty("userpass1","会员密码"))
                    return false;
                var url = "foreloginAjax";
                $.post(
                    url,
                    {
                        "name":$("#username1").val(),
                        "pass":$("#userpass1").val()
                    },
                    function (data) {
                        if(data=="fail")
                            $(".dangerDiv2").show();
                        else if(data=="success")
                            location.reload();
                    }
                );
            }
        );
        if($(".dangerDiv2").hasClass("error"))
        {
            $(".dangerDiv2").show();
        }
        else
        {
            $(".dangerDiv2").hide();
        }
    }
);